package vip.liux.backend.infrastructure.jpa.notification;

import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import vip.liux.contracts.models.notification.MessageTemplate;
import vip.liux.contracts.repositories.messaging.MessageTemplateRepository;

import java.util.List;

@Repository
public interface MessageTemplateJpaRepository extends MessageTemplateRepository {

    @Query("select p from MessageTemplate p where :templateCode is null or p.templateCode = :templateCode")
    @Override
    List<MessageTemplate> findAllByTemplateCode(String templateCode);
}
